package com.zixuan.sina.ai;

import opennlp.tools.tokenize.SimpleTokenizer;

public class ForumAIReviewer {
    public static boolean detectBadContent(String text) {
        String[] blacklist = {"sap", "傻逼", "市长"};
        SimpleTokenizer tokenizer = SimpleTokenizer.INSTANCE;
        String[] words = tokenizer.tokenize(text);

        for (String word : words) {
            for (String badWord : blacklist) {
                if (word.equalsIgnoreCase(badWord)) {
                    return true; // 发现违规内容
                }
            }
        }
        return false;
    }

    public static void main(String[] args) {
        String post = "sap";
        System.out.println(detectBadContent(post) ? "文章违规" : "文章合格");
    }
}
